#include <type_traits>

// 1、类型检查
template<typename T>
void process(T value) {
    static_assert(std::is_integral<T>::value, "T must be an integral type");
    // 函数实现...
}

// 2、编译时常量验证
constexpr int buffer_size = 1024;
static_assert(buffer_size > 0, "Buffer size must be positive");
static_assert(buffer_size % 4 == 0, "Buffer size must be divisible by 4");

// 3、平台或架构检查
static_assert(sizeof(void*) == 8, "This code requires 64-bit platform");

// 4、类型大小验证
static_assert(sizeof(int) == 4, "int must be 4 bytes");